package com.ls.controller.company;

import com.ls.controller.company.model.AddCompanyModel;
import com.ls.controller.company.model.EditCompanyModel;
import com.ls.service.ICompanyService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 企业 前端控制器
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@Api(value = "app企业相关接口", tags = "app企业相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/companyApp")
public class CompanyAppController {
    private final ICompanyService service;
    /** 新增企业  */
    @PostMapping("add")
    public ResultData add(@Valid @RequestBody AddCompanyModel model) {
        return service.add(model);
    }

    /** 更新企业  */
    @PostMapping("edit")
    public ResultData edit(@Valid @RequestBody EditCompanyModel model) {
        return service.update(model);
    }
    /** 查看企业  */
    @GetMapping("getCompany")
    public ResultData getCompany(Long customerId) {
        return service.getCompany(customerId);
    }
    /**判断当前用户是否设置企业信息*/
    @GetMapping("isSetCompany")
    public ResultData isSetCompany() {
        return service.isSetCompany();
    }
    /**ai生成短信要素判断*/
    @GetMapping("isSet")
    public ResultData isSet() {
        return service.isSet();
    }
}
